/**
 * 
 */
package controller;

import java.util.List;

import model.Recipe;

/**
 * Controls provides functionality to manage the current GUI display,
 * and updates the state of data from a database.
 * 
 * @author Matt Adams
 */
public interface Controls {
    /** Initializes and runs the default display for the application.*/
    void start();
    /** Retrieves user information after successful login. */
    void login(String username, String password);

    /**
     * Search database for recipes and stores results in my_current_recipes. 
     * @param searchConditions yList in the form {RecipeAttribute, value, RecipeAttribute, value, ...} where the value is that
     *  corresponding to the attribute listed one position previously in the list
     *  Valid RecipeAttributes are SEARCHSTRING, Cooking_Time, Prep_Time, Cuisine, Course, Difficulty
     */
    boolean search(List<String> searchConditions);
    
    /**
     * @param newRecipe List in the form {RecipeAttribute, Value, RecipeAttribute, Value,... } containing
     *  all the values of the new recipe. Recipe_ID is auto-generated and need not be added. 
     * @param ingredients List in the form {{Description, Style_Prep, Unit, Quantity}, 
     * 										{Description, Style_Prep, Unit, Quantity}...}
     * @param steps List in the form {step1, step2, step3, ...}
     * @return True if the recipe is successfully added to the database
     */
    boolean addRecipe(List<String> newRecipe, List<List<String>> ingredients, List<String> steps);
    /** Edit recipe in database. */
    /**
     * @param recipeInformation A list of values to be updated in the form 
     * {RecipeAttribute, value, RecipeAttribute, value, ...} where the value is that
     *  corresponding to the attribute listed one position previously in the list. 
     *  For any attribute that is listed more than once, an arbitrary one will be chosen.
     * @param recipeID The recipe to be updated
     * @return True if the recipe is updated
     */
    Recipe editRecipe(int recipeID, List<String> recipeInformation, List<List<String>> ingredients, List<String> steps);
    /** Display a recipe for easy reading. */
    void displayRecipe(Recipe the_recipe);
    /** Add recipe to user's favorites list. */
    void addFavorite(Recipe favorite);
    /** Remove a recipe from the user's favorite  */
    void removeFavorite(Recipe favorite);
    Boolean isFavorite(Recipe favorite);
    /** Add a new user 
     *  userInfo should be in the form {userID, name, password} 
     ***/
    void addUser(List<String> userInfo);
    /** Returns a list of recently viewed recipes. */
    List<Recipe> getRecentlyViewed();
    /** Returns a list of favorite recipes. */
    List<Recipe> getFavorites();
    
    //Navigation commands
    /** Go to search panel.*/
    void goSearch();
    /** Go to list of user's favorite recipes.*/
    void goFavorites();
    /** Go to list of user's recently viewed recipes.*/
    void goRecentlyViewed();
    /** Go to add recipe panel.*/
    void goAddRecipe();
    /** Got to edit recipe panel.*/
    void goEditRecipe(Recipe the_recipe);
    /** Go to Search Results panel */
    void goSearchResults();
    /** Logout user and returns to application's initial display.*/
    void logout();
    
    //Get Static Attributes
    List<String> getCuisines();
    List<String> getCourses();
    List<String> getDifficulty();
    List<String> getFoodGroups();
    List<String> getUnitMeasures();
}
